﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;

namespace SprintBoardMaker
{
    class TrelloColorToBGBrushConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (!(value is TrelloNet.Color))
                return Brushes.Black;

            switch ((TrelloNet.Color)value)
            {
                case TrelloNet.Color.Blue: return Brushes.Blue;
                case TrelloNet.Color.Green: return Brushes.Green;
                case TrelloNet.Color.Orange: return Brushes.Orange;
                case TrelloNet.Color.Purple: return Brushes.Purple;
                case TrelloNet.Color.Red: return Brushes.Red;
                case TrelloNet.Color.Yellow: return Brushes.Yellow;
                default: return Brushes.Black;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            // Should not be needed
            throw new NotImplementedException();
        }
    }
}
